package com.fen.demo004;

import com.fen.demo001.HelloWorldMessageProvider;
import com.fen.demo001.MessageProvider;
import com.fen.demo001.MessageRenderer;
import com.fen.demo001.StandardOutMessageRenderer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author : lrf
 * @description :
 * @tip :
 * @date : 2019/3/21
 */
@Configuration
public class HelloWorldConfiguration {

    @Bean
    public MessageProvider provider(){
        return new HelloWorldMessageProvider();
    }

    @Bean
    public MessageRenderer renderer(){
        StandardOutMessageRenderer re = new StandardOutMessageRenderer();
        re.setMessageProvider(provider());
        return re;
    }
}
